<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="<%=path%>/CSS/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
	<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript"
	src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
.seachform li label{line-height: 45px;color: #444444	}
.scinput{line-height: 10px;margin-top: 5px}
.scinput1{margin-top: 5px;height: 30px;}
.scbtn{background: #57a0ff;border-radius:20px;width: 110px;margin-top: 4px;height: 35px}
.scbtn2{height: 20px;background: #57a0ff;border-radius:20px;width: 50px;color: #fff;display: none;}
.tablelist th{background: none;border-bottom: none;}
thead {background: #f2f2f2}
tbody tr:nth-child(even) {background: #f7f8fd}

.tablelist td {
    border-right: none;
    text-align: center
}
tbody tr{height: 38px}
.check{padding-left: 0px}
a{cursor: pointer;}
.tablelist{width:500px;border:0px;border-collapse:collapse;border-spacing:0;}
.tablelist tr{height:40px;}
.tablelist tr td{border-bottom:1px solid #BBB;}
#table1 tr th{height: 20px;border-bottom: 1px solid #bbb;border-top: 1px solid #bbb;border-left: 1px solid #bbb;border-right: 1px solid #bbb}
 tr td {
           border: solid 1px #ccc;
        }
 .subjectOne {
 background: rgb(255,255,216);
 }
.selelects {

    width: 150px;
    height: 30px;

    width: 130px;
    height: 30px;

    line-height: 45px;
    margin-top: 7px;
    border: solid 1px #ccc;
}
.scinput {
        line-height: 10px;
        margin-top: 5px
    }

    .scinput1 {
        margin-top: 5px;
        height: 30px;
    }

    .scbtn {
        background: #57a0ff;
        border-radius: 20px;
        width: 110px;
        height: 35px;
        margin-left: 40px;
    }

    thead {
        background: #f2f2f2
    }

    .template th {
        height: 45px;
        background: none;
    }

    .template tr {
        height: 45px;
    }

    .template tr th {
        height: 20px;
        border-left: 1px solid #dddee6;
        border-right: 1px solid #dddee6;
        color: #444444;
        text-align: center;
    }

    .tou {
        background: #e4eafe
    }

    .kh {
        border-bottom: 1px solid #dddee6;
    }

    .shuju td {
        border: 1px solid #dddee6;
        color: #787c88;
        text-align: center;
    }

    .shuju:nth-child(odd) {
        background: #ffffff
    }

    .shuju:nth-child(even) {
        background: #f3f5fb
    }

    .shuju:last-child {
        border-bottom: 1px solid #dddee6;
    }

    .shuju:HOVER {
        background: #fff6cd;
    }
</style>
</head>
<body style="background: #f5f5f5;padding: 0 10px;">
	<div class="place" style="background: #f5f5f5; margin-top: 10px">
		<ul class="placeul">
			<li><a href="#">报表</a></li>
			<li><a href="#">管理报表</a></li>
			<li><a href="<%=path%>/DrivingSys/queryExamCollectJournalBySubject/look.action">驾校学员考试汇总表</a></li>
		</ul>
	</div>

	<div class="rightinfo"
		style="background: #fff; border-radius: 10px; height: 45px;">

		<form action="<%=path%>/DrivingSys/queryExamCollectJournalBySubject/look.action" method="post">
			<ul class="seachform">
				<li><label>科目</label>
                    <select class="selelects" name="subject" >
						<c:if test="${subject eq ''}">
							<option value="" selected="selected"></option>
							<option value="科目一">科目一</option>
							<option value="科目二">科目二</option>
							<option value="科目三">科目三</option>
						</c:if>
						<c:if test="${subject eq '科目一'}">
							<option value="" ></option>
							<option value="科目一" selected="selected">科目一</option>
							<option value="科目二">科目二</option>
							<option value="科目三">科目三</option>
						</c:if>
						<c:if test="${subject eq '科目二'}">
							<option value="" ></option>
							<option value="科目一">科目一</option>
							<option value="科目二" selected="selected">科目二</option>
							<option value="科目三">科目三</option>
						</c:if>
						<c:if test="${subject eq '科目三'}">
							<option value="" ></option>
							<option value="科目一">科目一</option>
							<option value="科目二">科目二</option>
							<option value="科目三" selected="selected">科目三</option>
						</c:if>
					</select>
				</li>		
				<li><label>开始时间</label><input class="scinput1" name="beginTime"
					type="text"
					onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM'})"
					id="datemin" class="input-text Wdate" style="width: 150px;"
					value="${beginTime}"></li>
				<li><label>结束时间</label><input class="scinput1" name="endTime"
					type="text"
					onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM'})"
					id="datemax" class="input-text Wdate" style="width: 150px;"
					value="${endTime}"></li>
				<li><label>&nbsp;</label><input name="" type="submit"
					class="scbtn" value="立即查询" /></li>
				<shiro:hasPermission name="/outXls">
					<li><label>&nbsp;</label><input name="" type="button" id="dc"
													class="scbtn" value="导出Excel" /></li>
				</shiro:hasPermission>
			</ul>
		</form>
	</div>
	<form action="<%=path%>/DrivingSys/outXls" method="post" id="outXls">
		<input id="xls" type="hidden" name="xls" value="">
        <input type="hidden" name="fileNames" value="考试汇总表">
	</form>

	<div style="width: 100%; overflow: auto; margin-top: 30px; background: #fff; box-shadow: 0 0 10px #f2f2f2; min-height: 600px;" class="info">
        <table class="template" style="width: 900px;" id="table1" align="center">
				<tr class="tou">
                    <th style="text-align: center; width: 5px; "></th>
                    <th colspan="7"
                        style="text-align: center; height: 20px; font-size: 18px; ">${beginTime}至${endTime} ${subject }考试情况汇总
                    </th>
				</tr>
				<tr  class="tou">
                    <th style="text-align: center; width: 2px"></th>
                    <th style="text-align: center; width: 10px">科目</th>
                    <th style="text-align: center; width: 20px">考试月份</th>
                    <th style="text-align: center; width: 10px">报考人数</th>
                    <th style="text-align: center; width: 10px">及格人数</th>
                    <th style="text-align: center; width: 10px">不及格人数</th>
                    <th style="text-align: center; width: 10px">未到人数</th>
                    <th style="text-align: center; width: 10px">及格率(%)</th>
					
				</tr>
				<!--科目一查询  -->
				<c:if test="${subject eq '科目一' }">				
				<c:forEach items="${subjectExamDetailList }" var="subjectExamDetail" varStatus="status">

					<tr class="shuju">
                    <td class="xuhao" style="text-align: center;width: 5px; "></td>
                    <td style="text-align: center; width: 10px">${subject}</td>
                    <td style="text-align: center; width: 20px">${subjectExamDetail.examDate }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_sum_children_one">${subjectExamDetail.sumEnterPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_pass_children_one">${subjectExamDetail.passExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_nopass_children_one">${subjectExamDetail.noPassExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_nojoin_children_one">${subjectExamDetail.noJoinExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_rate_children">${subjectExamDetail.passExamRate }</td>
                     </tr>
				</c:forEach>
					<tr class="shuju">
                        <td class="xuhao" style="text-align: center; width: 5px;"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;">小计</td>
                        <td style="text-align: center; width: 20px; background: rgb(255,255,216);font-weight:bold;"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_sum"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_pass"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_nopass"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_nojoin"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_rate"></td>
					</tr>
					
				</c:if>
				
				<!--科目二查询  -->
				<c:if test="${subject eq '科目二' }">				
				<c:forEach items="${subjectExamDetailList }" var="subjectExamDetail" varStatus="status">

					<tr class="shuju">
                    <td class="xuhao" style="text-align: center;width: 5px; "></td>
                    <td style="text-align: center; width: 10px">${subject}</td>
                    <td style="text-align: center; width: 20px">${subjectExamDetail.examDate }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_sum_children_two">${subjectExamDetail.sumEnterPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_pass_children_two">${subjectExamDetail.passExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_nopass_children_two">${subjectExamDetail.noPassExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_nojoin_children_two">${subjectExamDetail.noJoinExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_rate_children">${subjectExamDetail.passExamRate }</td>
                     </tr>
				</c:forEach>
						<tr class="shuju">
                        <td class="xuhao" style="text-align: center; width: 5px;"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;">小计</td>
                        <td style="text-align: center; width: 20px; background: rgb(255,255,216);font-weight:bold;"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_sum"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_pass"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_nopass"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_nojoin"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_rate"></td>
					</tr>
					
				</c:if>
				
				<!--科目三查询  -->
				<c:if test="${subject eq '科目三' }">				
				<c:forEach items="${subjectExamDetailList }" var="subjectExamDetail" varStatus="status">

					<tr class="shuju">
                    <td class="xuhao" style="text-align: center;width: 5px; "></td>
                    <td style="text-align: center; width: 10px">${subject}</td>
                    <td style="text-align: center; width: 20px">${subjectExamDetail.examDate }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_sum_children_three">${subjectExamDetail.sumEnterPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_pass_children_three">${subjectExamDetail.passExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_nopass_children_three">${subjectExamDetail.noPassExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_nojoin_children_three">${subjectExamDetail.noJoinExamPersons }</td>
                    <td style="text-align: center; width: 10px"
                        class="subject_rate_children">${subjectExamDetail.passExamRate }</td>
                     </tr>
				</c:forEach>
					<tr class="shuju">
                        <td class="xuhao" style="text-align: center; width: 5px;"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;">小计</td>
                        <td style="text-align: center; width: 20px; background: rgb(255,255,216);font-weight:bold;"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_sum"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_pass"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_nopass"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_nojoin"></td>
                        <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_rate"></td>
					</tr>
					
				</c:if>
				
				<!--全部科目查询  -->
				<c:if test="${subject eq '' }">							
				 <c:forEach items="${map.one}" var="subjectExamDetail" varStatus="status">
				 		<tr class="shuju">
                    	<td class="xuhao" style="text-align: center;width: 5px; "></td>
                    	<td style="text-align: center; width: 10px">${subjectExamDetail.subject}</td>
                    	<td style="text-align: center; width: 20px">${subjectExamDetail.examDate }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_sum_children_one" >${subjectExamDetail.sumEnterPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_pass_children_one">${subjectExamDetail.passExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_nopass_children_one">${subjectExamDetail.noPassExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_nojoin_children_one">${subjectExamDetail.noJoinExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_rate_children">${subjectExamDetail.passExamRate }</td>						
					</tr>                   
				</c:forEach> 
				<!--科目一小计  -->
				<tr class="shuju">
                    <td class="xuhao" style="text-align: center; width: 5px;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;">小计</td>
                    <td style="text-align: center; width: 20px; background: rgb(255,255,216);font-weight:bold;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_sum"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_pass"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_nopass"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_nojoin"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectone_rate"></td>
					</tr>
				<c:forEach items="${map.two}" var="subjectExamDetail" varStatus="status">
				 		<tr class="shuju">
                    	<td class="xuhao" style="text-align: center;width: 5px; "></td>
                    	<td style="text-align: center; width: 10px">${subjectExamDetail.subject}</td>
                    	<td style="text-align: center; width: 20px">${subjectExamDetail.examDate }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_sum_children_two">${subjectExamDetail.sumEnterPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_pass_children_two">${subjectExamDetail.passExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_nopass_children_two">${subjectExamDetail.noPassExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_nojoin_children_two">${subjectExamDetail.noJoinExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_rate_children_two">${subjectExamDetail.passExamRate }</td>						
					</tr>                   
				</c:forEach> 
				<!--科目二小计  -->
				<tr class="shuju">
                    <td class="xuhao" style="text-align: center; width: 5px;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;">小计</td>
                    <td style="text-align: center; width: 20px; background: rgb(255,255,216);font-weight:bold;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_sum"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_pass"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_nopass"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_nojoin"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjecttwo_rate"></td>
					</tr>
				<c:forEach items="${map.three}" var="subjectExamDetail" varStatus="status">
				 		<tr class="shuju">
                    	<td class="xuhao" style="text-align: center;width: 5px; "></td>
                    	<td style="text-align: center; width: 10px">${subjectExamDetail.subject}</td>
                    	<td style="text-align: center; width: 20px">${subjectExamDetail.examDate }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_sum_children_three">${subjectExamDetail.sumEnterPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_pass_children_three">${subjectExamDetail.passExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_nopass_children_three">${subjectExamDetail.noPassExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_nojoin_children_three">${subjectExamDetail.noJoinExamPersons }</td>
                    	<td style="text-align: center; width: 10px"
                        class="subject_rate_children_three">${subjectExamDetail.passExamRate }</td>						
					</tr>                   
				</c:forEach>
				<!--科目三小计  -->
				<tr class="shuju">
                    <td class="xuhao" style="text-align: center; width: 5px;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;">小计</td>
                    <td style="text-align: center; width: 20px; background: rgb(255,255,216);font-weight:bold;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_sum"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_pass"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_nopass"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_nojoin"></td>
                    <td style="text-align: center; width: 10px;background: rgb(255,255,216);font-weight:bold;"
                            class="subjectthree_rate"></td>
					</tr > 
				</c:if>
				<tr class="shuju">
                    <td class="xuhao" style="text-align: center; width: 5px;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(240,204,134);font-weight:bold;">总计</td>
                    <td style="text-align: center; width: 20px; background: rgb(240,204,134);font-weight:bold;"></td>
                    <td style="text-align: center; width: 10px;background: rgb(240,204,134);font-weight:bold;"
                            class="subject_sum_all"></td>
                    <td style="text-align: center; width: 10px;background: rgb(240,204,134);font-weight:bold;"
                            class="subject_pass_all"></td>
                    <td style="text-align: center; width: 10px;background: rgb(240,204,134);font-weight:bold;"
                            class="subject_nopass_all"></td>
                    <td style="text-align: center; width: 10px;background: rgb(240,204,134);font-weight:bold;"
                            class="subject_nojoin_all"></td>
                    <td style="text-align: center; width: 10px;background: rgb(240,204,134);font-weight:bold;"
                            class="subject_rate_all"></td>
				</tr> 																				
		</table>
	</div>	
</body>
<script type="text/javascript">
$(document).ready(function(){
	//处理序号
	$(".xuhao").each(function(i){
		 $(this).html(i+1) 
	})
	//总报考人数
	var sumPersons_one=0;//科目一
	var sumPersons_two=0;//科目二
	var sumPersons_three=0;//科目三
	$(".subject_sum_children_one").each(function (i){
		var num=$(this).text();
		num=Number(num)
		sumPersons_one+=num
	})
	$(".subject_sum_children_two").each(function (i){
		var num=$(this).text();
		num=Number(num)
		sumPersons_two+=num
	})
	$(".subject_sum_children_three").each(function (i){
		var num=$(this).text();
		num=Number(num)
		sumPersons_three+=num
	})	
	$(".subjectone_sum").text(sumPersons_one)//小计科目一报名人数	
	$(".subjecttwo_sum").text(sumPersons_two)//小计科目二报名人数	
	$(".subjectthree_sum").text(sumPersons_three)//小计科目三报名人数	
	$(".subject_sum_all").text(sumPersons_one+sumPersons_two+sumPersons_three)//总计报名人数
	
	//总及格人数
	var passPersons_one=0;
	var passPersons_two=0;
	var passPersons_three=0;
	$(".subject_pass_children_one").each(function (i){
		var num=$(this).text();
		num=Number(num)
		passPersons_one+=num
	})
	$(".subject_pass_children_two").each(function (i){
		var num=$(this).text();
		num=Number(num)
		passPersons_two+=num
	})
	$(".subject_pass_children_three").each(function (i){
		var num=$(this).text();
		num=Number(num)
		passPersons_three+=num
	})
	$(".subjectone_pass").text(passPersons_one)//小计科目一通过人数	
	$(".subjecttwo_pass").text(passPersons_two)//小计科目二通过人数	
	$(".subjectthree_pass").text(passPersons_three)//小计科目三通过人数
	$(".subject_pass_all").text(passPersons_one+passPersons_two+passPersons_three)//总计
	//总不及格人数
	var nopassPersons_one=0;
	var nopassPersons_two=0;
	var nopassPersons_three=0;
	$(".subject_nopass_children_one").each(function (i){
		var num=$(this).text();
		num=Number(num)
		nopassPersons_one+=num
	})
	$(".subject_nopass_children_two").each(function (i){
		var num=$(this).text();
		num=Number(num)
		nopassPersons_two+=num
	})
	$(".subject_nopass_children_three").each(function (i){
		var num=$(this).text();
		num=Number(num)
		nopassPersons_three+=num
	})
	$(".subjectone_nopass").text(nopassPersons_one)//小计科目一未通过人数
	$(".subjecttwo_nopass").text(nopassPersons_two)//小计科目二未通过人数
	$(".subjectthree_nopass").text(nopassPersons_three)//小计科目三未通过人数
	$(".subject_nopass_all").text(nopassPersons_one+nopassPersons_two+nopassPersons_three)//总计
	//总缺考人数
	var nojoinPersons_one=0;
	var nojoinPersons_two=0;
	var nojoinPersons_three=0;
	$(".subject_nojoin_children_one").each(function (i){
		var num=$(this).text();
		num=Number(num)
		nojoinPersons_one+=num
	})
	$(".subject_nojoin_children_two").each(function (i){
		var num=$(this).text();
		num=Number(num)
		nojoinPersons_two+=num
	})
	$(".subject_nojoin_children_three").each(function (i){
		var num=$(this).text();
		num=Number(num)
		nojoinPersons_three+=num
	})
	$(".subjectone_nojoin").text(nojoinPersons_one)//小计未参加科目一人数
	$(".subjecttwo_nojoin").text(nojoinPersons_two)//小计未参加科目二人数
	$(".subjectthree_nojoin").text(nojoinPersons_three)//小计未参加科目三人数
	$(".subject_nojoin_all").text(nojoinPersons_one+nojoinPersons_two+nojoinPersons_three)//总计
	//小计及格率
	var rateone =0;//科目一
	var ratetwo=0;//科目二
	var ratethree=0;//科目三
	rateone=$(".subjectone_pass").text()/$(".subjectone_sum").text()*100
	rateone=decimal(rateone,2)
	rateone=rateone.toFixed(2)
	$(".subjectone_rate").text(rateone);
	ratetwo=$(".subjecttwo_pass").text()/$(".subjecttwo_sum").text()*100.00
	ratetwo=decimal(ratetwo,2)
	ratetwo=ratetwo.toFixed(2)
	$(".subjecttwo_rate").text(ratetwo);
	ratethree=$(".subjectthree_pass").text()/$(".subjectthree_sum").text()*100.00
	ratethree=decimal(ratethree,2)
	ratethree=ratethree.toFixed(2)
	$(".subjectthree_rate").text(ratethree);
	//总及格率
	var rate_all =0;
	rate_all=(passPersons_one+passPersons_two+passPersons_three)/(sumPersons_one+sumPersons_two+sumPersons_three)*100
	rate_all=decimal(rate_all,2)
	rate_all=rate_all.toFixed(2)
	$(".subject_rate_all").text(rate_all)
	
    function _w_table_rowspan(_w_table_id, _w_table_colnum) {
        _w_table_firsttd = "";
        _w_table_currenttd = "";
        _w_table_SpanNum = 0;
        _w_table_Obj = $(_w_table_id + ' tr td:nth-child(' + _w_table_colnum + ')');
        _w_table_Obj.each(function (i) {
            if (i == 0) {
                _w_table_firsttd = $(this);
                _w_table_SpanNum = 1;
                _td = $(this).parent().find('td:eq(1)');

            }
            else {
                _w_table_currenttd = $(this);
                _td2 = $(this).parent().find('td:eq(1)');
                if (_td.text() == _td2.text()) {
                    _w_table_SpanNum++;
                    _w_table_currenttd.remove(); //remove();
                    _w_table_firsttd.attr("rowSpan", _w_table_SpanNum);
                } else {
                    _w_table_firsttd = $(this);
                    _td = $(this).parent().find('td:eq(1)');
                    _w_table_SpanNum = 1;
                }
            }
        });
    }

    _w_table_rowspan(".template", "2")

})

$("#dc").click(function(){
    var tableHtml = $(".info").html()
	$("#xls").val(tableHtml)
	//alert($("#xls").val())
	$("#outXls").submit();
})
//num是要处理的数字  v为要保留的小数位数
function decimal(num,v){
	var vv = Math.pow(10,v);
return Math.round(num*vv)/vv;
}


</script>
</html>